<?php

namespace App\Http\Controllers;

use App\Http\Requests\distributionRequest;
use App\Models\ClueDistribution;
use App\User;
use Illuminate\Http\Request;

class ClueDistributionController extends Controller
{

    public function distribution(User $user, distributionRequest $request)
    {
        $id = $request->get('id');

        ClueDistribution::whereIn('clue_id' , $id)->delete();

        $user->clues()->attach($id);
        return $this->responseSuccess();
    }

}
